import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/Login'),
    meta: { pageName: '登录页' }
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/home/Home'),
    meta: { pageName: '首页' }
  },
  {
    path: '/editPassword',
    name: 'EditPassword',
    component: () => import('@/views/login/EditPassword'),
    meta: { pageName: '修改密码' }
  },
  {
    path: '/previewImg',
    name: 'PreviewImg',
    component: () => import('@/views/preview/PreviewImg'),
    meta: { pageName: '全文图片预览' }
  },
  {
    path: '/previewPdf',
    name: 'PreviewPdf',
    component: () => import('@/views/preview/PreviewPdf'),
    meta: { pageName: '全文pdf预览' }
  },
  {
    path: '/auth',
    name: 'Auth',
    component: () => import('@/views/anth/Auth'),
    meta: { pageName: '权限设置' }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
